<template>
  <view class="container">
    <uni-card is-full :is-shadow="false">
      <text class="uni-h6">常用于展示鼠标 hover 时的提示信息，注意：无法覆盖原生组件</text>
    </uni-card>
    <uni-section title="基础用法" type="line" padding>
	  <uni-tooltip content="提示文字">
	    <button>被包裹的组件</button>
	  </uni-tooltip>
    </uni-section>
    <uni-section title="自定义弹出层方向" type="line" padding>
			<view class="direction-container">
				<uni-tooltip content="示例文字" placement="top">
					<view class="item">上</view>
				</uni-tooltip>
				<uni-tooltip class="item" content="示例文字" placement="bottom">
					<view class="item">下</view>
				</uni-tooltip>
				<uni-tooltip class="item" content="示例文字" placement="left">
					<view class="item">左</view>
				</uni-tooltip>
				<uni-tooltip class="item" content="示例文字" placement="right">
					<view class="item">右</view>
				</uni-tooltip>
			</view>
		</uni-section>
  </view>
</template>

<script>
  export default {
    components: {},
    data() {
      return {};
    },
  };
</script>

<style lang="scss">
  .direction-container {
		display: flex;
		width: 100px;
		margin: 0 auto;
		flex-wrap: wrap;
	}

	.item {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 40px;
		height: 40px;
		background-color: #ebebeb;
		border-radius: 10px;
		margin: 5px;
	}
</style>
